<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form id="my_form" action="" onsubmit="xxx" onreset="xxxxx">
        <input type="text" name="username" id="">
        <input type="password" name="password" id="">
        <button onclick="myFrom.reset(); return false;" type="button">重置</button>
        <button onclick="myFrom.submit();" type="button">提交</button>
    </form>
    <script>
        // P5.52
        // var myFrom = document.getElementById('my_form');
        var myFrom = document.forms[0];
        
        // myFrom.submit();
        // myFrom.reset();
    </script>
</body>

</html>